package com.ecnu.sei.app.course;

import com.ecnu.sei.app.resources.Time;
import com.ecnu.sei.app.util.Utils;
import com.ecnu.sei.app.util.Utils.DayHour;


/*
 *  SpecialtyElective course rules:
 *  
 *  1. at the same DayHour and Classroom as that of CourseInfo
 *  2. Elective course exams and Compulsory course exams take place in different weeks
 *     so that there should be no collision between them
 */

public class SpecialtyElective extends AbstractCourse {

  
  public SpecialtyElective() {
    super();
  }

  @Override
  public boolean setResource() {
    ExamInfo examInfo = info.getExamInfo();
    String date = Utils.getDateByOffset(scheduler.electiveStartTime, info.getDayOfWeek());
    DayHour dayHour = info.getDayHour();
    examInfo.setTime(new Time(date, dayHour))
            .setClassroom(info.getClassroom())
            .setProctorNum(info.getStudentNum() >= 60 ? 3 : 2);
    return true;
  }

  @Override
  public void setResourcePending() {
    // do nothing here
  }

 
}
